﻿<%@ Page Language="C#" MasterPageFile="~/LoginTemplate.master" AutoEventWireup="true"
    CodeFile="Login.aspx.cs" Inherits="Login" Title="Crux Login" EnableEventValidation="false" %>

<%--
    EnableEventValidation turned off becuase of an issue with Ajax 1.0 which is needed
    for ad-hoc reporting. Will need to remove this once ad-hoc reporting is fixed 
    purely for security reasons.  
--%>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="crux" %>
<%@ Register Src="Controls/Common/WaterMarkedTextBox.ascx" TagName="WaterMarkedTextBox"
    TagPrefix="crux" %>
<%@ Register Src="Controls/Common/Calendar/CalendarScriptManager.ascx" TagName="CalendarScriptManager"
    TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:UpdatePanel ID="updatePanelLogin" runat="server">
        <ContentTemplate>
            
            <asp:Panel ID="pnlLogin" runat="server" Visible="true">
                
                    <div id="loginbox">
                        <div class="loginheader">Login</div>
                        <div class="labelusername">
                            <asp:Label runat="server" ID="lblUserName" Text="User Name:" CssClass="loginLabel" />
                        </div>
                        <div class="inputusername">
                                <crux:WaterMarkedTextBox 
                                                    ID="txtUserName" 
                                                    runat="server" 
                                                    WaterMarkText="Enter Your UserName Here"
                                                    
                                                    MaxLength="200" 
                                                    ErrorText="Username is required. This is usually your primary email address. Please enter a valid email address to Login."
                                                    CheckEmailFormat="true" 
                                                    ValueRequired="true" TextBoxCss="loginTextInputStyle" />
                        </div>     
                        <div class="labelpassword">
                            <asp:Label runat="server" ID="lblPassword" Text="Password:" CssClass="loginLabel" />
                        </div>
                        <div class="inputpassword">
                                <crux:WaterMarkedTextBox 
                                                    ID="txtPassword" 
                                                    runat="server" 
                                                    WaterMarkText="Password"
                                                     
                                                    MaxLength="200" 
                                                    TextMode="Password" 
                                                    ErrorText="Password is required. We can't log you in with an empty password!"
                                                    ValueRequired="true" TextBoxCss="loginTextInputStyle"/>
                        </div>
                        <div class="buttonbox" >
                            <div class="spacerleft"></div>
                            <div class="actionbutton">
                                <div class="loginBtnDiv">
                                    <asp:Button ID="btnLogin" runat="server" Text="Login" OnClick="btnLogin_Click" />
                                </div>
                                <div class="cancelBtnDiv">
                                    <input type="reset" value="Cancel" class="buttonStyle" />
                                </div>
                            </div>
                            

                        </div>
                        <div class="forgotpasswordbox">
                            <div class="spacerleft"></div>
                            <div>
                                <asp:LinkButton ID="lnkForgotPassword" runat="server" CausesValidation="false" OnClick="lnkForgotPassword_Click" CssClass="linkbutton">Forgot Password?</asp:LinkButton>
                            </div>
                        </div>

                    </div>
 
  <%--              <table cellpadding="0" cellspacing="0" class="loginTable">
                    <tr>
                        <td align="center" valign="top" class="loginBorderWhite">
                            <center>
                                <table cellpadding="0" cellspacing="0" width="80%">
                                    <tr>
                                        <td colspan="2" style="height: 26px;">
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="left" colspan="2" class="loginTxtBold">
                                            LOGIN
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" style="height: 12px;">
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right" style="width: 50%;">
                                            <asp:Label runat="server" ID="lblUserName" Text="User Name:" CssClass="loginLabel" />
                                        </td>
                                        <!-- CreativeTODO: Add readable watermark to the password field as per the technique -->
                                        <!-- Described in the following link -->
                                        <!-- http://forums.asp.net/p/1069447/1556026.aspx -->
                                        <td align="left" style="width: 50%;">
                                            <crux:WaterMarkedTextBox ID="txtUserName" runat="server" WaterMarkText="Enter Your UserName Here"
                                                Width="180" MaxLength="200" ErrorText="Username is required. This is usually your primary email address. Please enter a valid email address to Login."
                                                CheckEmailFormat="true" ValueRequired="true" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" style="height: 6px;">
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right">
                                            <asp:Label runat="server" ID="lblPassword" Text="Password:" CssClass="loginLabel" />
                                        </td>
                                        <td align="left">
                                            <crux:WaterMarkedTextBox ID="txtPassword" runat="server" WaterMarkText="Password"
                                                Width="180" MaxLength="200" TextMode="Password" ErrorText="Password is required. We can't log you in with an empty password!"
                                                ValueRequired="true" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" style="height: 12px;">
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                        </td>
                                        <td align="left">
                                            <asp:Button ID="btnLogin" runat="server" Text="Login" OnClick="btnLogin_Click" />&nbsp;&nbsp;<input
                                                type="reset" value="Cancel" class="buttonStyle" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" style="height: 26px;">
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">
                                            <asp:LinkButton ID="lnkForgotPassword" runat="server" CausesValidation="false" OnClick="lnkForgotPassword_Click">Forgot Password?</asp:LinkButton>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" style="height: 26px;">
                                        </td>
                                    </tr>
                                </table>
                            </center>
                        </td>
                    </tr>
                </table>--%>
            </asp:Panel>

            <asp:Panel runat="server" ID="pnlAccessDenied" Visible="false">
                <table border="0" cellpadding="2" cellspacing="2" class="calloutStyle">
                    <tr>
                        <td colspan="2" style="height: 5px;">
                        </td>
                    </tr>
                    <tr>
                        <td align="right" valign="middle">
                            <img src="appimages/invalid.gif" alt="" />
                        </td>
                        <td align="left" valign="middle">
                            Invalid user name and password!
                        </td>
                    </tr>
                </table>
            </asp:Panel>
            <asp:Panel ID="pnlApplicationDisabled" runat="server" Visible="false">
                Application is disabled. You Cannot Login to the Application. Please contact the
                administrator to continue. 
            </asp:Panel>
            <asp:Panel ID="pnlPasswordExpirationWarning" runat="server" Visible="false">
                <table>
                    <tr>
                        <td colspan="2">
                            <asp:Label ID="lblMessage" runat="server" Text="Your password will expire in "></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Button ID="BtnChng" runat="server" Text="Change Password" OnClick="BtnChng_Click"/>
                        </td>
                        <td>
                            <asp:Button ID="btnContinue" runat="server" Text="Continue" OnClick="btnContinue_Click" />
                        </td>
                    </tr>
                </table>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
